home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / hdr / gp1reg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-03  |  3.8 KB  |  152 lines

  1. /* @(#)gp1reg.h 1.10 88/02/08 SMI */
  2.  
  3. /*
  4.  * Copyright 1985, 1987 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef    gp1reg_DEFINED
  8. #define    gp1reg_DEFINED
  9.  
  10. #define    GP1_SIZE        65536
  11. #define    GP1_SHMEM_SIZE        32768
  12. #define    GP1_SHMEM_OFFSET    32768
  13.  
  14. #define    GP2_SIZE        262144
  15.  
  16. #define    GP1_BLOCK_SHORTS    512
  17. #define    GP1_BLOCKS        32
  18. #define    GP1_CONTROL_BLOCKS    1
  19. #define    GP1_POST_BLOCKS        23
  20. #define    GP1_STATIC_BLOCKS    8
  21.  
  22. #define    GP1_POST_SLOTS        256
  23.  
  24. /* GP1 board layout */
  25. struct gp1 {
  26.     union gp1_reg {
  27.         struct gp1reg {
  28.             short gpr_ident;
  29.             union {
  30.                 short status;
  31.                 short control;
  32.             } gpr_csr;
  33.             short gpr_ucode_addr;
  34.             short gpr_ucode_data;
  35.         } reg;
  36.         struct gp2reg {
  37.             short ident;
  38.             short :16;
  39.             u_int xp_addr;
  40.             u_int xp_data_h;
  41.             u_int xp_data_l;
  42.             u_int rp_addr;
  43.             u_int rp_data;
  44.             u_int pp_addr;
  45.             u_int pp_data_h;
  46.             u_int pp_data_l;
  47.             u_int status;
  48.             u_int control;
  49.             u_int pp_addr2;
  50.         } reg2;
  51.         u_short ureg[16384];
  52.     } reg;
  53.     struct gp1_shmem {
  54.         u_short    host_count;
  55.         u_short gp_count;
  56.         u_char ver_flag;
  57.         u_char alloc_sem;
  58.         u_short host_alloc_h;
  59.         u_short host_alloc_l;
  60.         u_short gp_alloc_h;
  61.         u_short gp_alloc_l;
  62.         u_char flag2;
  63.         u_char post_sem;
  64.         u_short post_buf[GP1_POST_SLOTS];
  65.         u_char block_owners[GP1_BLOCKS];
  66.         u_short fill280[228];
  67.         u_short ver_release;
  68.         u_short ver_serial;
  69.         u_short fill510[2];
  70.         u_short post[GP1_POST_BLOCKS][GP1_BLOCK_SHORTS];
  71.         u_short stat[GP1_STATIC_BLOCKS][GP1_BLOCK_SHORTS];
  72.     } shmem;
  73. };
  74.  
  75. /* convert block number to bit mask, owner array index */
  76. #define    GP1_ALLOC_BIT(blk)    ((u_long) 0x80000000 >> (blk))
  77. #define    GP1_OWNER_INDEX(blk)    (GP1_BLOCKS - 1 - (blk))
  78.  
  79. /* register offsets and bit definitions */
  80.  
  81. #define    GP1_BOARD_IDENT_REG    0
  82. #define    GP1_ID_MASK        0xfe
  83. #define    GP1_ID_VALUE        0xea
  84.  
  85. #define    GP1_CONTROL_REG        1
  86. #define    GP1_CR_CLRIF        0x8000
  87. #define    GP1_CR_IENBLE        0x0300
  88. #define    GP1_CR_INT_TOGGLE    0x0300
  89. #define    GP1_CR_INT_DISABLE    0x0200
  90. #define    GP1_CR_INT_ENABLE    0x0100
  91. #define    GP1_CR_INT_NOCHANGE    0x0000
  92. #define    GP1_CR_RESET        0x0040
  93. #define    GP1_CR_VP_CONTROL    0x0038
  94. #define    GP1_CR_VP_STRT0        0x0020
  95. #define    GP1_CR_VP_HLT        0x0010
  96. #define    GP1_CR_VP_CONT        0x0008
  97. #define    GP1_CR_PP_CONTROL    0x0007
  98. #define    GP1_CR_PP_STRT0        0x0004
  99. #define    GP1_CR_PP_HLT        0x0002
  100. #define    GP1_CR_PP_CONT        0x0001
  101.  
  102. #define    GP1_STATUS_REG        1
  103. #define    GP1_SR_IFLG        0x8000
  104. #define    GP1_SR_IEN        0x4000
  105. #define    GP1_SR_RESET        0x0400
  106. #define    GP1_SR_VP_STATE        0x0200
  107. #define    GP1_SR_PP_STATE        0x0100
  108. #define    GP1_SR_VP_STATUS    0x00F0
  109. #define    GP1_SR_PP_STATUS    0x000F
  110.  
  111. #define    GP1_UCODE_ADDR_REG    2
  112. #define    GP1_UCODE_DATA_REG    3
  113.  
  114.  
  115. /* GP2 definitions */
  116. #define    GP2_ID_MASK        0xff
  117. #define    GP2_ID_VALUE        0xec
  118.  
  119. /* GP2 control register bits (active low) */
  120. #define    GP2_CR_XP_RST        0x40000000
  121. #define    GP2_CR_XP_HLT        0x20000000
  122. #define    GP2_CR_RP_RST        0x10000000
  123. #define    GP2_CR_RP_HLT        0x08000000
  124. #define    GP2_CR_PP_RST        0x02000000
  125. #define    GP2_CR_PP_HLT        0x01000000
  126.  
  127. /* GP2 status register message shifts */
  128. #define    GP2_SR_XPMSG_SHIFT    16
  129. #define    GP2_SR_RPMSG_SHIFT    8
  130. #define    GP2_SR_PPMSG_SHIFT    0
  131.  
  132.  
  133. /* shared memory offsets */
  134. #define    GP1CB_HOST_COUNT    0    /* host command count */
  135. #define    GP1CB_GP_COUNT        1    /* GP command count */
  136. #define    GP1CB_ALLOC_SEM        2    /* buffer allocation semaphore */
  137. #define    GP1CB_HOST_ALLOC_H    3    /* host block allocation bit vector */
  138. #define    GP1CB_HOST_ALLOC_L    4    /*    high/low */
  139. #define    GP1CB_GP_ALLOC_H    5    /* GP block allocation bit vector */
  140. #define    GP1CB_GP_ALLOC_L    6    /*    high/low */
  141. #define    GP1CB_POST_SEM        7    /* command posting semaphore */
  142. #define    GP1CB_POST_BUF        8    /* command posting buffer, 256 words */
  143. #define    GP1CB_BLOCK_OWNERS    264    /* minor device number for owner */
  144.                     /* of each block -- reverse order! */
  145.  
  146. #define    GP1CB_VER_FLAG        2    /* version info is valid if */
  147.                     /*    high byte is 1 */
  148. #define    GP1CB_VER_RELEASE    508    /* major/minor release numbers */
  149. #define    GP1CB_VER_SERIAL    509    /* serial number/version flag */
  150.  
  151. #endif    gp1reg_DEFINED
  152.